package com.erlang.springbootinit.entity;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * Created by IntelliJ IDEA.
 *
 * @author ZGQ
 */
@Component
@ConfigurationProperties(prefix = "customer")
public class Customer {
    /* 用户名 */
    @Value("${customer.username}")
    private String username;

    /* 性别 */
    @Value("${customer.gender}")
    private String gender;

    /* 地址 */
    @Value("${customer.address[0]}")
    private String[] address;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String[] getAddress() {
        return address;
    }

    public void setAddress(String[] address) {
        this.address = address;
    }

    @Override
    public String toString() {
        return "Customer{" +
                "username='" + username + '\'' +
                ", gender='" + gender + '\'' +
                '}';
    }
}
